package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.zyp.mvcframework.annotations.LgAutowired;
import com.lagou.zyp.mvcframework.annotations.LgController;
import com.lagou.zyp.mvcframework.annotations.LgRequestMapping;
import com.lagou.zyp.mvcframework.annotations.LgSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 郑样平
 * @date 2021/4/30  17:46
 */
@LgController
@LgRequestMapping(value = "/demo")
@LgSecurity(value = {"zs","ls"})
public class DemoController {

    @LgAutowired
    private IDemoService iDemoService;

    /**
     * URL: /demo/query?name=lisi
     * @param request
     * @param response
     * @param name
     * @return
     */
    @LgRequestMapping("/query")
    @LgSecurity(value = {"zs","ls","ww"})
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        return iDemoService.get(name);
    }
}
